import request from '@/utils/request'

// 兑换券 新增发行
export async function releaseAdd(params) {
  const { success, data, msg, code } = await request({
    url: '/Coupon/releaseAdd',
    method: 'post',
    params
  })
  return { success, msg }
}
// 兑换券 增量发行
export async function releaseAddCount(params) {
  const { success, data, msg, code } = await request({
    url: '/Coupon/releaseAddCount',
    method: 'post',
    params
  })
  return { success, msg }
}

// 兑换券 修改发行
export async function releaseEdit(params) {
  const { success, data, msg, code } = await request({
    url: '/Coupon/releaseEdit',
    method: 'post',
    params
  })
  return { success, msg }
}

// 兑换券 启用 禁用 发行
export async function SetState(params) {
  const { success, data, msg, code } = await request({
    url: '/Coupon/SetState',
    method: 'post',
    params
  })
  return { success, msg }
}

// 商品兑换券发布详情
export async function first(params) {
  const res = await request({
    url: '/Coupon/first',
    method: 'post',
    params
  })
  return res
}

// 兑换券 执行发行处理
export async function Release(params) {
  const { success, data, msg, code } = await request({
    url: '/Coupon/Release',
    method: 'post',
    params
  })
  return { success, msg }
}

// 兑换券  导出excel
export async function Coupon_excel(params) {
  const { success, data, msg, code } = await request({
    url: '/Coupon/Coupon_excel',
    method: 'get',
    params
  })
  return { success, msg }
}

// 兑换券  领取明细
export async function CouponPage(params) {
  const res = await request({
    url: '/Coupon/CouponPage',
    method: 'post',
    params
  })
  return res
}

// 兑换券 发货
export async function CouponSetState(params){
  const { success, data, msg, code } = await request({
    url:"/Coupon/CouponSetState",
    method: 'post',
    params
  })
  return { success, msg }
}